﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NHINDirect
{
    public class NHINDException : Exception
    {
        public NHINDException()
        {
        }
        
        public NHINDException(string message)
            : base(message)
        {
        
        }
        
        public NHINDException(string message, Exception innerException)
            : base(message, innerException)
        {
        }
    }
    
    public class NHINDException<T> : NHINDException
    {
        T m_error;
        
        public NHINDException(T error)
        {
            this.m_error = error;
        }

        public NHINDException(T error, string message)
            : base(message)
        {
            this.m_error = error;
        }
        
        public NHINDException(T error, Exception innerException)
            : this(error, string.Empty, innerException)
        {
            this.m_error = error;
        }
        
        public NHINDException(T error, string message, Exception innerException)
            : base(message, innerException)
        {
            this.m_error = error;
        }
        
        public T Error
        {
            get
            {
                return this.m_error;
            }
        }

        public override string ToString()
        {
            return string.Format("ERROR={0};\r\n", this.m_error, base.ToString());
        }
    }
}
